package nacos.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 *
 * @Author: future
 * @Date:2022/8/14:23:48
 */
@RestController
@RefreshScope
public class ConfigController {

    /**
     * 需要在配置中心配置的，如果没有，需要这里给默认值，否则无法启动
     */
    @Value("${config.info}")
    private String configInfo;

    @GetMapping(value = "/config/info")
    public String getConfigInfo() {
        return configInfo;
    }

    @GetMapping(value = "/config/test")
    public String getInfo() {
        return "haha";
    }

}
